function RunApplication($curPath,$name,$param) {    
    Start-Job -ScriptBlock{
        #进入项目
        $currentApplicationPath = $curPath+'\'+$name+'\'
        cd $currentApplicationPath
        #编译打包
        mvn clean package
        #运行 jar
        $targetPath = '.\'+$name+'\target\'+$name+'-0.0.1-SNAPSHOT.jar'
        & java -jar $targetPath+' '+$param
    }    
}

# 获取当前路径
$curPath =  (gi .).FullName

# 运行Eureka peer1
RunApplication $curPath 'euraka' '--spring-profiles-active=peer1'